include('shared.lua')

function ENT:Draw()
	self:DrawModel()
	render.SetMaterial( Material( "Sprites/light_glow02_add" ) )
	render.DrawSprite( self:GetPos(), 150, 150, Color(255,100,50,255))
end

function ENT:Think()
	self:NextThink( 0 )
	
        		
		local emitter = self.Emitter
		if !emitter then return end

		local vPos = Vector( 1, 1, 0 )
		local R = math.Rand( 0.8, 1 )
		local vOffset = self:LocalToWorld( Vector(-5, 0, self:OBBMins().z+5) )

		emitter:SetPos( vOffset )
		
			
			local smoke = emitter:Add( "sprites/glow04_noz", vOffset + vPos )
			smoke:SetVelocity( VectorRand() * math.Rand(-95,95) )
			smoke:SetGravity( Vector( math.Rand(-200,200), math.Rand(-100,100), math.Rand(45,100) ) )
			smoke:SetDieTime( math.Rand(0.5,0.7) )
			smoke:SetStartAlpha( 100 ) 
			smoke:SetStartSize( math.Rand( 2,5) )
			smoke:SetEndSize( math.Rand( 1,5 ) )
			smoke:SetRoll( math.Rand(-180,180) )
			smoke:SetRollDelta( math.Rand(-0.2,0.2) )
			smoke:SetColor(150, 100,55 )
			smoke:SetAirResistance( 10 )
			smoke:SetCollide( true )
			



		self.Emitter:Finish()
	
	return true
end